Skip to content

Refactor/user function handling modules + Manager can run additional worker on thread#1216

Merged
jlnav merged 85 commits intodevelopfrom
refactor/user_function_handling_modules
Mar 20, 2024
Merged

Refactor/user function handling modules + Manager can run additional worker on thread#1216
jlnav merged 85 commits intodevelopfrom
refactor/user_function_handling_modules

Conversation

@jlnav
Copy link
Copy Markdown
Member

@jlnav jlnav commented Jan 9, 2024

Addresses #1166

User - Manager runs local worker on thread - Gen Worker 0

The manager can start an additional worker thread with the worker ID 0.

This worker is, via W["gen_worker"] = True, and filtering options, made to run gens only.

Tentative interface: libE_specs["gen_on_manager"] = True

Internal - Refactor runners.py

Largely refactors utils/runners.py so additional "Runners" for user functions can be more easily developed/extended.

GlobusComputeRunner and ThreadRunner inherit from Runner.

Runner inspects the contents of the input sim/gen specs and instantiates the correct subclass on the left-hand-side:

>>> sim_specs = {... , "globus_compute_endpoint": "1234}
>>> runner = Runner(sim_specs)
>>> runner
<libensemble.utils.runners.GlobusComputeRunner object at 0x1490ec190>
>>> runner = Runner({"sim_f": print})
>>> runner
<libensemble.utils.runners.Runner object at 0x104e024d0>

Internal - _WorkerIndexer class for indexing into worker arrays

Internal - Workers can be assigned gen_worker.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants